package jun.learn.spring.threadexecutor.javathreadpool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ExecutorTest {
	public static void main(String[] args) {
		ExecutorService executorService = Executors.newFixedThreadPool(2);
//		TestThread t1 = new TestThread();
//		TestThread t2 = new TestThread();
//		TestThread t3 = new TestThread();
//		TestThread t4 = new TestThread();
//		TestThread t5 = new TestThread();
//		executorService.execute(t1);
//		executorService.execute(t2);
//		executorService.execute(t3);
//		executorService.execute(t4);
//		executorService.execute(t5);
		
		for(int i = 0; i < 1000; i++){
			TestThread t = new TestThread();
			executorService.execute(t);
		}
		executorService.shutdown();
		
	}
}
